package com.sqoop.server.sender;

import com.sqoop.commons.send.impl.JmsClient;
import com.sqoop.core.destnation.MqMsgDestination;
import com.sqoop.core.msg.Msg;
import com.sqoop.core.request.Response;
import com.sqoop.server.BaseProcess;

/**
 * Created by zw on 2017/11/14.
 */
public class SenderProcess extends BaseProcess{

    private JmsClient jmsClient = new JmsClient();

    @Override
    public void process(Msg msg) {
        //msg.ge
        if (msg instanceof Response){
            Response response = (Response)msg;
            if (response.getReceiver() instanceof MqMsgDestination){
                jmsClient.send(response);
            }
        }

    }

    @Override
    public void init() {

    }

    @Override
    public void stop0() {

    }

    @Override
    public void pause0() {

    }
}